﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.WindowsAzure.ServiceRuntime;

namespace BasicClasses
{
    public class SintomaDataSource
    {
        private static SintomaContext context = new SintomaContext();
        private static string tableName = RoleEnvironment.GetConfigurationSettingValue("SintomaTable");

        public static IEnumerable<Sintoma> SelectAll()
        {
            return context.Sintomas;
        }

        public static void Add(Sintoma sintoma, string partitionKey) //partitionKey == Pais
        {
            sintoma.PartitionKey = partitionKey;
            sintoma.RowKey = Guid.NewGuid().ToString();
            context.AddObject(tableName, sintoma);
            context.SaveChanges();
        }
    }
}
